<!DOCTYPE html>

<html lang="en" data-content_root="./">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Maestro on Zephyr &#8212; Maestro on Zephyr  documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d1102ebc" />
    <link rel="stylesheet" type="text/css" href="_static/basic.css?v=686e5160" />
    <link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=27fed22d" />
    <script src="_static/documentation_options.js?v=5929fcd5"></script>
    <script src="_static/doctools.js?v=9bcbadda"></script>
    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Maestro sample for recording data from microphone to RAM" href="samples/record_ram/README.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <span class="target" id="maestrozephyrreadme"></span><section id="maestro-on-zephyr">
<h1>Maestro on Zephyr<a class="headerlink" href="#maestro-on-zephyr" title="Link to this heading">¶</a></h1>
<ul class="simple">
<li><p>Based on and tested with Zephyr version, given by tag v4.0.0</p></li>
<li><p>Tested with Zephyr SDK version 16.4</p></li>
<li><p>To see the pre-built documentation, see: <a class="reference external" href="doc/doc/README.html">README.html</a>. Also see the <a class="reference internal" href="#documentation"><span class="std std-ref">documentation section</span></a>.</p></li>
</ul>
<div class="toctree-wrapper compound">
</div>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#maestro-environment-setup" id="id3">Maestro environment setup</a></p></li>
<li><p><a class="reference internal" href="#build-and-run-maestro-example" id="id4">Build and run Maestro example</a></p>
<ul>
<li><p><a class="reference internal" href="#using-command-line" id="id5">Using command line</a></p></li>
<li><p><a class="reference internal" href="#using-mcuxpresso-for-vs-code" id="id6">Using MCUXpresso for VS Code</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#folder-structure" id="id7">Folder structure</a></p></li>
<li><p><a class="reference internal" href="#supported-elements-and-libraries" id="id8">Supported elements and libraries</a></p></li>
<li><p><a class="reference internal" href="#examples-support" id="id9">Examples support</a></p></li>
<li><p><a class="reference internal" href="#creating-your-own-example" id="id10">Creating your own example</a></p></li>
<li><p><a class="reference internal" href="#documentation" id="id11">Documentation</a></p></li>
<li><p><a class="reference internal" href="#faq" id="id12">FAQ</a></p></li>
</ul>
</nav>
<section id="maestro-environment-setup">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Maestro environment setup</a><a class="headerlink" href="#maestro-environment-setup" title="Link to this heading">¶</a></h2>
<p>Follow these steps to set up a Maestro development environment on your machine.</p>
<ol class="arabic">
<li><p>If you haven’t already, please follow <a class="reference external" href="https://docs.zephyrproject.org/latest/develop/getting_started/index.html">this guide</a> to set up a Zephyr development environment and its dependencies first:</p>
<blockquote>
<div><ul class="simple">
<li><p>Cmake</p></li>
<li><p>Python</p></li>
<li><p>Devicetree compiler</p></li>
<li><p>West</p></li>
<li><p>Zephyr SDK bundle</p></li>
</ul>
</div></blockquote>
</li>
<li><p>Get Maestro. You can pick either of the options listed below. If you need help deciding which option is the best fit for your needs, please see the <a class="reference internal" href="#faq"><span class="std std-ref">FAQ</span></a>.</p>
<blockquote>
<div><ul>
<li><p>Freestanding Maestro - This option pulls in only Maestro’s necessary dependencies.</p>
<blockquote>
<div><p>Run:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mf">1.</span> <span class="n">west</span> <span class="n">init</span> <span class="o">-</span><span class="n">m</span> <span class="o">&lt;</span><span class="n">maestro</span> <span class="n">repository</span> <span class="n">url</span><span class="o">&gt;</span> <span class="o">--</span><span class="n">mr</span> <span class="o">&lt;</span><span class="n">revision</span><span class="o">&gt;</span> <span class="o">--</span><span class="n">mf</span> <span class="n">west</span><span class="o">-</span><span class="n">freestanding</span><span class="o">.</span><span class="n">yml</span> <span class="o">&lt;</span><span class="n">foldername</span><span class="o">&gt;</span>
<span class="mf">2.</span> <span class="n">cd</span> <span class="o">&lt;</span><span class="n">foldername</span><span class="o">&gt;</span>
<span class="mf">3.</span> <span class="n">west</span> <span class="n">update</span>
</pre></div>
</div>
</div></blockquote>
</li>
<li><p>Maestro as a Zephyr module</p>
<blockquote>
<div><p>To include Maestro into Zephyr, update Zephyr’s <code class="docutils literal notranslate"><span class="pre">west.yml</span></code> file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">projects</span><span class="p">:</span>
<span class="n">name</span><span class="p">:</span> <span class="n">maestro</span>
<span class="n">url</span><span class="p">:</span> <span class="o">&lt;</span><span class="n">maestro</span> <span class="n">repository</span> <span class="n">url</span><span class="o">&gt;</span>
<span class="n">revision</span><span class="p">:</span> <span class="o">&lt;</span><span class="n">revision</span> <span class="k">with</span> <span class="n">Zephyr</span> <span class="n">support</span><span class="o">&gt;</span>
<span class="n">path</span><span class="p">:</span> <span class="n">modules</span><span class="o">/</span><span class="n">audio</span><span class="o">/</span><span class="n">maestro</span>
<span class="n">import</span><span class="p">:</span> <span class="n">west</span><span class="o">.</span><span class="n">yml</span>
</pre></div>
</div>
<p>Then run <code class="docutils literal notranslate"><span class="pre">west</span> <span class="pre">update</span> <span class="pre">maestro</span></code> command.</p>
</div></blockquote>
</li>
</ul>
</div></blockquote>
</li>
</ol>
</section>
<section id="build-and-run-maestro-example">
<h2><a class="toc-backref" href="#id4" role="doc-backlink">Build and run Maestro example</a><a class="headerlink" href="#build-and-run-maestro-example" title="Link to this heading">¶</a></h2>
<p>These steps will guide you through building and running Maestro samples.
You can use either the command line utilizing Zephyr’s powerful <code class="docutils literal notranslate"><span class="pre">west</span></code> tool or you can use VS Code’s GUI.
Detailed steps for both options are listed below.</p>
<section id="using-command-line">
<h3><a class="toc-backref" href="#id5" role="doc-backlink">Using command line</a><a class="headerlink" href="#using-command-line" title="Link to this heading">¶</a></h3>
<p>See Zephyr’s <a class="reference external" href="https://docs.zephyrproject.org/latest/develop/west/build-flash-debug.html">Building, Flashing and Debugging</a> guide if you aren’t familiar with it yet.</p>
<ol class="arabic">
<li><p>To <strong>build</strong> a project, run:</p>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">west</span> <span class="n">build</span> <span class="o">-</span><span class="n">b</span> <span class="o">&lt;</span><span class="n">board</span><span class="o">&gt;</span> <span class="o">-</span><span class="n">d</span> <span class="o">&lt;</span><span class="n">output</span> <span class="n">build</span> <span class="n">directory</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">path</span> <span class="n">to</span> <span class="n">example</span><span class="o">&gt;</span> <span class="o">-</span><span class="n">p</span>
</pre></div>
</div>
<p>For example, this compiles VIT example for rd_rw612_bga board:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mf">1.</span> <span class="n">cd</span> <span class="n">maestro</span><span class="o">/</span><span class="n">zephyr</span>
<span class="mf">2.</span> <span class="n">west</span> <span class="n">build</span> <span class="o">-</span><span class="n">b</span> <span class="n">rd_rw612_bga</span> <span class="o">-</span><span class="n">d</span> <span class="n">build</span> <span class="n">samples</span><span class="o">/</span><span class="n">vit</span> <span class="o">-</span><span class="n">p</span>
</pre></div>
</div>
</div></blockquote>
</li>
<li><p>To <strong>run</strong> a project, run:</p>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">west</span> <span class="n">flash</span> <span class="o">-</span><span class="n">d</span> <span class="o">&lt;</span><span class="n">directory</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>e.g.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">west</span> <span class="n">flash</span> <span class="o">-</span><span class="n">d</span> <span class="n">build</span>
</pre></div>
</div>
</div></blockquote>
</li>
<li><p>To <strong>debug</strong> a project, run:</p>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">west</span> <span class="n">debug</span> <span class="o">-</span><span class="n">d</span> <span class="o">&lt;</span><span class="n">directory</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>e.g.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">west</span> <span class="n">debug</span> <span class="o">-</span><span class="n">d</span> <span class="n">build</span>
</pre></div>
</div>
</div></blockquote>
</li>
</ol>
</section>
<section id="using-mcuxpresso-for-vs-code">
<h3><a class="toc-backref" href="#id6" role="doc-backlink">Using MCUXpresso for VS Code</a><a class="headerlink" href="#using-mcuxpresso-for-vs-code" title="Link to this heading">¶</a></h3>
<p>For this you have to have NXP’s <a class="reference external" href="https://github.com/nxp-mcuxpresso/vscode-for-mcux">MCUXpresso for VS Code extension</a> installed.</p>
<ol class="arabic">
<li><p>Import your topdir as a repository to MCUXPresso for VS Code:</p>
<blockquote>
<div><ul class="simple">
<li><p>Open the MCUXpresso Extension. In the <em>Quickstart Panel</em> click <em>Import Repository</em>.</p></li>
<li><p>In the displayed menu click <em>LOCAL</em> tab and select the folder location of your <em>topdir</em>.</p></li>
<li><p>Click <em>Import</em>.</p></li>
<li><p>The repository is successfully added to the <em>Installed Repositories</em> view once the import is successful.</p></li>
</ul>
</div></blockquote>
</li>
<li><p>To import any project from the imported repository:</p>
<blockquote>
<div><ul class="simple">
<li><p>In the <em>Quickstart Panel</em> click <em>Import Example from Repository</em>.</p></li>
<li><p>For <strong>Repository</strong> select <em>your imported</em> repository.</p></li>
<li><p>For <strong>Zephyr SDK</strong> the installed Zephyr SDK is selected automatically. If not, select one.</p></li>
<li><p>For <strong>Board</strong> select your board (<em>make sure</em> you’ve selected the <em>correct</em> revision).</p></li>
<li><p>For <strong>Template</strong> select the folder path to your project.</p></li>
<li><p>Click the <em>Create</em> button.</p></li>
</ul>
</div></blockquote>
</li>
<li><p>Build the project by clicking the <em>Build Selected</em> icon (displayed on hover) in the extension’s <em>Projects</em> view. After the build, the debug console window displays the memory usage (or compiler errors if any).</p></li>
<li><p>Debug the project by clicking the <em>Debug</em> (play) icon (displayed on hover) in the extension’s <em>Projects</em> view.</p></li>
<li><p>The execution will pause. To continue execution click <em>Continue</em> on the debug options.</p></li>
<li><p>In the <em>SERIAL MONITOR</em> tab of your console panel, the application prints the Zephyr boot banner during startup and then prints the test results.</p></li>
</ol>
</section>
</section>
<section id="folder-structure">
<h2><a class="toc-backref" href="#id7" role="doc-backlink">Folder structure</a><a class="headerlink" href="#folder-structure" title="Link to this heading">¶</a></h2>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>maestro/
├─── ...
└─── zephyr/                All Zephyr related files
    ├── samples/            Sample examples
    ├── tests/              Tests
    ├── audioTracks/        Audio tracks for testing
    ├── doc/                Documentation configuration for Sphinx
    ├── wrappers/           NXP SDK Wrappers
    ├── scripts/            Helper scripts, mostly for testing
    ├── module.yml          Defines module name, Cmake and Kconfig locations
    ├── CMakeList.txt       Defines module&#39;s build process
    ├── Kconfig             Defines module&#39;s configuration
    ├── osa/                Deprecated. OSA port for Zephyr
    └── ...
</pre></div>
</div>
</section>
<section id="supported-elements-and-libraries">
<h2><a class="toc-backref" href="#id8" role="doc-backlink">Supported elements and libraries</a><a class="headerlink" href="#supported-elements-and-libraries" title="Link to this heading">¶</a></h2>
<p>Here is the list of all features currently supported in Maestro on Zephyr.
Our goal is to support all features in Maestro on Zephyr that are already supported in Maestro on NXP’s SDK and to extend them further.</p>
<p><strong>Supported elements:</strong></p>
<blockquote>
<div><ul class="simple">
<li><p>Memory source</p></li>
<li><p>Memory sink</p></li>
<li><p>Audio source</p></li>
<li><p>Audio sink</p></li>
<li><p>Process sink</p></li>
<li><p>Decoder</p></li>
<li><p>Encoder</p></li>
</ul>
</div></blockquote>
<p><strong>Supported decoders:</strong></p>
<blockquote>
<div><ul class="simple">
<li><p>WAV</p></li>
<li><p>MP3</p></li>
<li><p>FLAC</p></li>
<li><p>OPUS OGG</p></li>
<li><p>AAC</p></li>
</ul>
</div></blockquote>
<p><strong>Supported encoders:</strong></p>
<blockquote>
<div><ul class="simple">
<li><p>OPUS RAW</p></li>
</ul>
</div></blockquote>
<p><strong>Supported libraries:</strong></p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="https://www.nxp.com/design/design-center/software/embedded-software/voice-intelligent-technology-wake-word-and-voice-command-engines:VOICE-INTELLIGENT-TECHNOLOGY">VIT</a></p></li>
</ul>
</div></blockquote>
</section>
<section id="examples-support">
<h2><a class="toc-backref" href="#id9" role="doc-backlink">Examples support</a><a class="headerlink" href="#examples-support" title="Link to this heading">¶</a></h2>
<p>All included examples use UART as output.
Examples are located in <code class="docutils literal notranslate"><span class="pre">zephyr/tests</span></code> and <code class="docutils literal notranslate"><span class="pre">zephyr/samples</span></code> directories.</p>
<p><strong>List of included examples:</strong></p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="samples/record_ram/README.html#maestro-sample-record-ram"><span class="std std-ref">Maestro sample for recording data from microphone to RAM</span></a></p></li>
<li><p><a class="reference internal" href="samples/record_vit/README.html#maestro-sample-record-vit"><span class="std std-ref">Maestro voice detection sample using VIT</span></a></p></li>
<li><p><a class="reference internal" href="tests/encoder/README.html#maestro-sample-encoder"><span class="std std-ref">Maestro encoder sample</span></a></p></li>
<li><p><a class="reference internal" href="tests/decoder/README.html#maestro-sample-decoder"><span class="std std-ref">Maestro decoder sample</span></a></p></li>
<li><p><a class="reference internal" href="tests/memToMem/README.html#maestro-sample-memtomem"><span class="std std-ref">Maestro mem2mem sample</span></a></p></li>
</ul>
</div></blockquote>
<p><strong>Examples support for specific boards:</strong></p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Example</p></th>
<th class="head"><p>RDRW612BGA</p></th>
<th class="head"><p>LPCxpresso55s69</p></th>
<th class="head"><p>MIMXRT1060EVKB</p></th>
<th class="head"><p>MIMXRT1170EVKB</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="samples/record_ram/README.html#maestro-sample-record-ram"><span class="std std-ref">Record</span></a></p></td>
<td><p>YES</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="samples/record_vit/README.html#maestro-sample-record-vit"><span class="std std-ref">VIT</span></a></p></td>
<td><p>YES</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="tests/encoder/README.html#maestro-sample-encoder"><span class="std std-ref">Encoder</span></a></p></td>
<td><p>In progress: OPUS RAW</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="tests/decoder/README.html#maestro-sample-decoder"><span class="std std-ref">Decoder</span></a></p></td>
<td><p>YES - WAV, FLAC, OPUS OGG</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="tests/memToMem/README.html#maestro-sample-memtomem"><span class="std std-ref">Mem2mem</span></a></p></td>
<td><p>YES</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
<td><p>TO BE TESTED</p></td>
</tr>
</tbody>
</table>
</section>
<section id="creating-your-own-example">
<h2><a class="toc-backref" href="#id10" role="doc-backlink">Creating your own example</a><a class="headerlink" href="#creating-your-own-example" title="Link to this heading">¶</a></h2>
<p>There are two ways to create your own example - you can either one of the included examples as a reference or you can create your own example from scratch by hand.</p>
<p>When creating your own example from scratch, set <code class="docutils literal notranslate"><span class="pre">CONFIG_MAESTRO_AUDIO_FRAMEWORK=y</span></code> in your <code class="docutils literal notranslate"><span class="pre">prj.conf</span></code> file. Then you can start enabling specific elements by setting <code class="docutils literal notranslate"><span class="pre">CONFIG_MAESTRO_ELEMENT_&lt;NAME&gt;_ENABLE=y</span></code>.</p>
<p>However, the recommended way to edit config options is to open gui-config (or menuconfig) by calling <code class="docutils literal notranslate"><span class="pre">west</span> <span class="pre">build</span> <span class="pre">-t</span> <span class="pre">guiconfig</span></code>.
Then you can use the graphical interface to interactively turn on/off the features you need.</p>
</section>
<section id="documentation">
<span id="id1"></span><h2><a class="toc-backref" href="#id11" role="doc-backlink">Documentation</a><a class="headerlink" href="#documentation" title="Link to this heading">¶</a></h2>
<p>Please note, Maestro documentation is under reconstruction. It is currently mixing several tools and formats.</p>
<p>To see the pre-generated Maestro Zephyr documentation, see <code class="docutils literal notranslate"><span class="pre">zephyr/doc/doc/README.html</span></code></p>
<p>To generate the Zephyr documentation, go under <code class="docutils literal notranslate"><span class="pre">zephyr/doc</span></code> folder and execute <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">html</span></code>. Sphinx version <code class="docutils literal notranslate"><span class="pre">sphinx-build</span> <span class="pre">8.1.3</span></code> must be installed. Open <code class="docutils literal notranslate"><span class="pre">doc/doc/html/README.hml</span></code> afterwards.</p>
<p>To see Maestro core documentation, go to the Maestro top directory and see <code class="docutils literal notranslate"><span class="pre">README.md</span></code>.</p>
</section>
<section id="faq">
<span id="id2"></span><h2><a class="toc-backref" href="#id12" role="doc-backlink">FAQ</a><a class="headerlink" href="#faq" title="Link to this heading">¶</a></h2>
<ol class="arabic">
<li><p>Should I choose the freestanding version of Maestro or should integrate it into my west instead?</p>
<blockquote>
<div><ul class="simple">
<li><p>Freestanding version of Maestro pulls in all the dependencies it needs including Zephyr itself.</p></li>
<li><p>Integrating it as a module is easier if you already have your Zephyr environment set up.</p></li>
</ul>
</div></blockquote>
</li>
</ol>
</section>
</section>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="#">Maestro on Zephyr</a></h1>









<search id="searchbox" style="display: none" role="search">
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script><h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Maestro on Zephyr</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/record_ram/README.html">Record sample</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/record_vit/README.html">VIT sample</a></li>
<li class="toctree-l1"><a class="reference internal" href="tests/decoder/README.html">Decoder sample</a></li>
<li class="toctree-l1"><a class="reference internal" href="tests/encoder/README.html">Encoder sample</a></li>
<li class="toctree-l1"><a class="reference internal" href="tests/memToMem/README.html">Mem2mem sample</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="#">Documentation overview</a><ul>
      <li>Next: <a href="samples/record_ram/README.html" title="next chapter">Maestro sample for recording data from microphone to RAM</a></li>
  </ul></li>
</ul>
</div>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &#169;2024.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 1.0.0</a>
      
      |
      <a href="_sources/README.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>